package com.laoda.ikun_food.entity.vo;

import java.io.Serializable;
import java.util.HashMap;

public class ResponseData extends HashMap<String, Object> implements Serializable {
    public ResponseData code(int code) {
        this.put("code", code);
        return this;
    }

    public ResponseData msg(String msg) {
        this.put("msg", msg);
        return this;
    }

    public ResponseData data(Object data) {
        this.put("data", data);
        return this;
    }

    public static ResponseData ok() {
        return new ResponseData().code(200).msg("ok");
    }

    public static ResponseData err(String msg) {
        return new ResponseData().code(500).msg(msg);
    }
}
